<div class="post2">
    <h2>Editar a <%= @horse.horse_name %></h2>
    <br/>
    <% form_for(@horse) do |f| %>
    <%= f.error_messages %>
    <br/>
    <table width='630px' border='3px' cellpadding='0' cellspacing='0' bordercolor='#d1ccc7'>
        <tr>
            <td>
                <div class="margen3">
                    <span style="FLOAT: left">
                        <table width='80%'>
                            <tr>
                                <td width="30%" height="50px">
                                    <%= f.label 'Nombre del caballo' %>
                                    <br/>
                                    <%= f.text_field :horse_name %>
                                </td>
                                <td>
                                </td>
                                <td width="30%" height="50px">
                                    <%= f.label 'Sexo o Genero' %>
                                    <br/>
                                    <select name="horse[horse_sex_id]">
                                        <% @horsesexes.each do |horsesexe| %>
                                        <option value="<%= horsesexe.id %>"<%= 'selected' if horsesexe.id == @horse.horse_sex_id %>><%= horsesexe.sex_name %>
                                        </option>
                                        <% end %>
                                    </select>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td width="30%" height="50px">
                                    <%= f.label 'Familia del caballo' %>
                                    <br/>
                                    <select id="proven" name="provenances[provenance_id]">
                                        <% @provenances.each do |provenance| %>
                                        <option value="<%= provenance.id %>"><%= provenance.provenance %>
                                        </option>
                                        <% end %>
                                    </select>
                                    <select id="fam" name="horse[family_id]">
                                        <% @families.each do |familie| %>
                                        <option value="<%= familie.id %>"<%= 'selected' if familie.id == @horse.family_id %>><%= familie.family_name %>
                                        </option>
                                        <% end %>
                                    </select>
                                    <%= observe_field("proven",
                                    :frequency => 0.25,
                                    :update => "fam",
                                    :url => { :controller=>"families", :action => :find_provenance},
                                    :with => "'id='id") %>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td width="30%" height="50px">
                                    <%= f.label 'Fecha de nacimiento' %>(aaaa)
                                    <br/>
                                    <%= f.text_field :born %>
                                </td>
                                <td>
                                    <img src="/images/calen.png" border="0px" align="left" style="padding-right:10px";  alt="calen">
                                </td>
                                <td width="30%" height="50px">
                                    <%= f.label 'Fecha de fallecimiento' %>(Opcional)
                                    <br/>
                                    <%= f.text_field :died %>
                                </td>
                                <td>
                                    <img src="/images/calen.png" border="0px" align="left" style="padding-right:10px";  alt="calen">
                                </td>
                            </tr>
                            <tr>
                                <td width="30%" height="60px">
                                    <%= f.label 'Madre del caballo' %>
                                    <br/>
                                    <%= f.text_field :mother_horse_id %>
                                </td>
                                <td width="70px" align="bottom">
                                    <%= link_to '<img src="/images/searchhorse.png" border="0px" align="left" style="padding-right:10px"; alt="Madre" title="Buscar Madre">', '/horses/search',:class=>'nyroModal opacityit', :rev=>'gal' %>
                                </td>
                                <td width="30%" height="50px">
                                    <%= f.label 'Padre del caballo' %>
                                    <br/>
                                    <%= f.text_field :father_horse_id %>
                                </td>
                                <td>
                                    <%= link_to '<img src="/images/searchhorse.png" border="0px" align="left" style="padding-right:10px"; alt="Padre" title="Buscar Padre">', '/horses/search',:class=>'opacityit nyroModal', :rev=>'gal' %>
                                </td>
                            </tr>
                        </table>
                    </span>
                    <%= link_to '<img src="/images/profile2.png" border="0px" align="left" style="padding-right:10px"; alt="Ver Perfiel" title="Ver Perfiel">', @horse, :class => 'opacityit' %>
                    <table height="240">
                        <tr>
                            <td>
                            </td>
                        </tr>
                    </table>
                </div>
                <div class="margen4">
                    <span style="FLOAT: left">
                        <div alin="center">
                            <%= f.submit 'Actualizar' %>
                        </div>
                    </span>
                    <div>
                        <%= button_to 'Cancelar', horses_path %>
                    </div>
                </div>
                <% end %>
            </td>
        </tr>
    </table>
</div>
</div>
<div id="sidebar2">
    <ul>
        <li>
            <h2>Herramientas</h2>
            <ul>
                <li>
                    <%= link_to 'Insertar Caballo', new_horse_path %>
                </li>
                <li>
                    <%= link_to 'Ver Familias', families_path %>
                </li>
                <li>
                    <%= link_to 'Ver Jefes de Razas', breedheads_path %>
                </li>
            </ul>
        </li>
    </ul>
</div>
